Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. It runs only for pull requests into main, so it runs once this pull request targets main.
No blocking findings. One optional suggestion:
CommentComposer.tsx:593runs the caller'sonClickbefore the composer focuses its input. A caller that moves focus synchronously loses it on a press in the composer's empty space. Consider calling it after the focus step, or documenting the order and pinning it in the new test.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: stacked on the previous Comments fix and touches none of CommentPin's files: verified, all three files are under
packages/lab/src/Comments. - Claim: applies cleanly to
main: verified with a clean three-way merge ontomain. - Claim: a standalone composer's
onClicknever ran and its clicks never reached ancestors: verified, the composer set its ownonClickafter the spread and always stopped propagation. - Claim: the composer now calls the caller's
onClickfirst and stops propagation only for a reply or an edit: verified atCommentComposer.tsx:571-598. - Claim: the public component API record promises that event props reach the root: verified.
- Claim: the defect exists on
main: verified, the file onmainmatches the base. - Claim: no API, visual or other behavior change: verified. The only behavior change is the one the title names, and it also covers the Comments panel's new-comment composer.
- Claim: the new composer test fails without the fix and passes with it, and the thread test keeps a reply composer's empty-space press from closing the thread: verified by reading both tests against the base and head code.
- Claim: the Comments tests, the pre-review checklist, Prettier and ESLint pass: left to CI, not reproduced in this review.
- Claim: rebased onto
mainat the stated commit: verified. - File
CommentComposer.tsx: one optional suggestion (above); otherwise clear. - File
CommentComposer.test.tsx: clear. - File
CommentThread.test.tsx: clear.
| // The composer keeps its clicks: in a thread, a press on its empty | ||
| // space would otherwise reach the thread and collapse it. | ||
| event.stopPropagation(); | ||
| onRootClick?.(event); |
There was a problem hiding this comment.
Optional: the caller's handler runs before the composer's own work, and it cannot cancel that work. So a caller that moves focus synchronously here, for example into a panel it opens, loses that focus: on a press in the composer's empty space, the composer then focuses its input. Consider calling onRootClick?.(event) after the focus step, or documenting the order on onClick and pinning it in the new test.
a72ff8b to
f90cbbd
Compare
26286ae to
6fb0bbf
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. It runs only for pull requests into main, so it runs once this pull request targets main.
No blocking findings. One optional suggestion:
CommentComposer.tsx:593runs the caller'sonClickbefore the composer focuses its input. A caller that moves focus synchronously loses it on a press in the composer's empty space. Consider calling it after the focus step, or documenting the order and pinning it in the new test.
Claims and files checked
Review mode: carry-forward; reason: none
- Claim: stacked on the previous Comments fix and touches none of CommentPin's files: verified, all three files are under
packages/lab/src/Comments. - Claim: applies cleanly to
main: verified with a clean three-way merge ontomain. - Claim: a standalone composer's
onClicknever ran and its clicks never reached ancestors: verified, the composer set its ownonClickafter the spread and always stopped propagation. - Claim: the composer now calls the caller's
onClickfirst and stops propagation only for a reply or an edit: verified atCommentComposer.tsx:571-598. - Claim: the public component API record promises that event props reach the root: verified.
- Claim: the defect exists on
main: verified, the file onmainmatches the base. - Claim: no API, visual or other behavior change: verified. The only behavior change is the one the title names, and it also covers the Comments panel's new-comment composer.
- Claim: the new composer test fails without the fix and passes with it, and the thread test keeps a reply composer's empty-space press from closing the thread: verified by reading both tests against the base and head code.
- Claim: the Comments tests, the pre-review checklist, Prettier and ESLint pass: left to CI, not reproduced in this review.
- Claim: validated on
mainand rebased ontomainat the stated commits: verified, both commits are onmainand the second is this branch's merge base withmain. - File
CommentComposer.tsx: one optional suggestion (above); otherwise clear. - File
CommentComposer.test.tsx: clear. - File
CommentThread.test.tsx: clear.
f90cbbd to
ee9ee12
Compare
6fb0bbf to
0026f37
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. It runs only for pull requests into main, so it runs once this pull request targets main.
No blocking findings. One optional suggestion:
CommentComposer.tsx:593runs the caller'sonClickbefore the composer focuses its input, so a caller that moves focus synchronously loses it on a press in the composer's empty space (reproduced locally). ConsidercomposeEventHandlers(handleRootClick, onRootClick)so the composer runs first, or documenting the order and pinning it in the new test.
Claims and files checked
Review mode: full; reason: recipe-changed (many rules)
- Title, the caller's
onClickruns: verified, reproduced locally. The new test and extra clicks on the input, an enabled Post and the emoji button each call it once, and none did before. - Title, a click bubbles outside a thread: verified, reproduced locally. The same clicks now reach an ancestor handler, while reply and edit composers still stop them.
- Stacked on the previous Comments fix and touches none of CommentPin's files: verified. All three files are under
packages/lab/src/Comments. - Applies cleanly to
main: verified. This pull request's own change merges onto currentmainwithout conflicts. - Before the fix, a standalone composer's
onClicknever ran and its clicks never reached ancestors: verified. The composer set its ownonClickafter the spread and always stopped propagation, and the new test fails against the old component. - Only a composer inside a thread needs the stop: verified. Of the four composer call sites, only the reply and edit composers sit inside a clickable thread surface.
- The composer now calls the caller's
onClickfirst and stops propagation only for a reply or an edit: verified atCommentComposer.tsx:571-598. The context type has exactly those three kinds. - The public component API record promises that event props reach the root and that built-in behavior composes with them: verified against its forwarding and handler-composition clauses.
- A component audit item flags this defect on
main: the defect is onmain, where the file matches this branch's base. The audit list itself is not in the repository, so this is reported. - No API, visual or other behavior change: verified. The only behavior change is the one the title names, and it also covers the Comments panel's new-comment composer.
- The new composer test fails without the fix, and the thread test keeps a reply composer's empty-space press from closing the thread: verified, reproduced locally. The thread test also fails once the thread stop is removed.
- Event wiring with no layout or pixel effect: verified. The change touches no markup or style.
- Scope checklist (one defect, no tagalongs, no hidden API or interaction change, no internal context): verified.
- The Comments tests pass: verified, reproduced locally.
- The pre-review checklist, Prettier and ESLint are clean: reported. Locally, Prettier passes, and ESLint shows no errors and one existing warning on an unchanged line.
- Validated on
mainand rebased ontomainat the stated commits: verified. Both commits are onmain, and the second is this branch's merge base withmain. - File
CommentComposer.tsx: one optional suggestion (above); otherwise clear. - File
CommentComposer.test.tsx: clear. - File
CommentThread.test.tsx: clear.
ee9ee12 to
22561bb
Compare
…outside a thread CommentComposer set its own root onClick after the caller's props, so a caller's `onClick` never ran, and it stopped every click from bubbling. The caller's handler now runs first. Only a reply or edit composer inside a thread stops the click, so a press on its empty space does not collapse the thread.
0026f37 to
e026f57
Compare
|
Rebased onto Repeated on this head: |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. It runs only for pull requests into main, so it runs once this pull request targets main.
No blocking findings. One optional suggestion:
CommentComposer.tsx:593runs the caller'sonClickbefore the composer focuses its input, so a caller that moves focus synchronously loses it on a press in the composer's empty space (reproduced locally). ConsidercomposeEventHandlers(handleRootClick, onRootClick)so the composer runs first, or documenting the order and pinning it in the new test.
Claims and files checked
Review mode: carry-forward; reason: none
- Title, the caller's
onClickruns: verified, reproduced locally. The new test and extra clicks on the input, an enabled Post and the emoji button each call it once on this head, and none did on the base. - Title, a click bubbles outside a thread: verified, reproduced locally. The same clicks now reach an ancestor handler, while reply and edit composers still stop them.
- Stacked on the previous Comments fix and touches none of CommentPin's files: verified. The base branch is that fix's branch, and all three files are under
packages/lab/src/Comments. - Applies cleanly to
mainon its own: verified. This pull request's own commit merges without conflicts onto the statedmaincommit and onto currentmain. - Rebased onto
mainwith no change to its own diff: verified. Its patch is byte-identical to the one reviewed before the rebase, with the same patch ID. - Before the fix, a standalone composer's
onClicknever ran and its clicks never reached ancestors: verified. The composer set its ownonClickafter the spread and always stopped propagation, and the new test fails against the old component (reproduced locally). - Only a composer inside a thread needs the stop: verified. Of the four composer call sites, only the reply and edit composers sit inside a clickable thread surface.
- The composer now calls the caller's
onClickfirst and stops propagation only for a reply or an edit: verified atCommentComposer.tsx:571-598. The context type has exactly those three kinds. - The public component API record promises that event props reach the root and that built-in behavior composes with them: verified against its forwarding and handler-composition clauses.
- A component audit item flags this defect on
main: the defect is onmain, where the file matches this branch's base. The audit list itself is not in the repository, so this is reported. - No API, visual or other behavior change: verified. The only behavior change is the one the title names, and it also covers the Comments panel's new-comment composer.
- The new composer test fails without the fix, and the thread test keeps a reply composer's empty-space press from closing the thread: verified, reproduced locally. The thread test also fails once the thread stop is removed.
- Event wiring with no layout or pixel effect: verified. The change touches no markup or style.
- Scope checklist (one defect, no tagalongs, no hidden API or interaction change, no internal context): verified.
- The Comments tests pass, 101 of them on this head: verified, reproduced locally (4 files, 101 passed).
- The pre-review report shows 0 findings: verified, reproduced locally.
- Prettier and ESLint are clean on the changed files: reported. Locally, Prettier passes, and ESLint shows no errors and one existing warning on an unchanged line.
- File
CommentComposer.tsx: one optional suggestion (above); otherwise clear. - File
CommentComposer.test.tsx: clear. - File
CommentThread.test.tsx: clear.
Stacked on #13737 (the previous Comments fix) only so the Comments move includes it. It touches none of CommentPin's files and applies cleanly to
main(2608fe4) on its own.User impact
A product that passes
onClickto a standaloneCommentComposer, for example to track a press or open a panel, never sees it run. Clicks inside a standalone composer also never reach its ancestors, so a host's own click handling around it breaks.Problem and solution fit
onClicknever run? The composer set its own rootonClickafter spreading the caller's props, so its handler replaced the caller's.architecture:public-component-apipromises that a component forwards neutral DOM event props. A silently dropped handler is hard to find.The composer now calls the caller's
onClickfirst. It stops propagation only inside a thread (a reply or an edit), where the thread would otherwise close.Expected behavior and authority
architecture:public-component-api: the root forwards neutral DOM and event props, and component-owned behavior composes with them instead of replacing them.onClickand stops every click. It was confirmed in the source onmain.Smallest restoration
CommentComposertakes the caller'sonClickout of the root props, calls it from its own handler, and stops propagation only when its context is a reply or an edit. No API, visual, or other behavior change.Evidence
onClickinside a parent withonClick, and presses the composer. Neither handler runs.CommentComposer.test.tsx"calls the caller's onClick and lets the click bubble" (fails without the fix) and the thread case inCommentThread.test.tsx.This is event wiring with no layout or pixel effect, so there are no screenshots.
Scope
Components: CommentComposer
Testing
vitest run packages/lab/src/Comments: pass. The new composer case fails without the fix.pnpm review:pre: 0 findings.prettierandeslinton the changed files: clean.Rebased onto
mainat 2608fe4, with no change to its own diff (the same patch ID as before the rebase). Repeated on this head:vitest run packages/lab/src/Comments: 101 passed.pnpm review:pre: 0 findings.